/**
  * global.js
  * Copyright 2012 MicroStrategy Incorporated. All rights reserved.
  * @version 1.0

  * @fileoverview <p>Javascript Helper Object for _Interface MicroStrategy Web Plug-in.</p>
  */
var mstrInterfacePlugin = {
    /**
     * Gets invoked on the browser's onload. Currently, it allows for the logo icon to invoke a popup
     * in order to show the shortcuts only on the mstrWeb servlet.
     */
    init: function () {
        // Adjust the logo
        var logo = document.getElementById('mstrStarburst'),
            servletName = microstrategy.servletName,
            href;

        // We will remove the tooltip on the logo since it's misleading.
        if (logo) {
            logo.title = '';
            // Remove the misleading tooltip "projects". The id changed since logo id was changed in the jsp.
            var logoSmall = document.getElementById('mstrLogo');
            
            if (logoSmall) {
                logoSmall.title = '';
            }

        // Do this only for the web servlet.
            if (microstrategy.hasSession && (servletName === 'mstrWeb' || servletName === 'Main.aspx') && logo.getAttribute('_isstatic') != 'true') {
            href = logo.href;
            
            logo.href = "#";
            logo.setAttribute('_href', href);
            
            // Check if the user has set the preference to open menus onmouseover.
            var event = microstrategy.menuHover ? 'mouseover' : 'click';
            logo['on' + event] = microstrategy.showShortcutsList;
        }
        
            //position logo at left end of pathbar
            var pathNode = document.getElementById('mstrWeb_path');
            if (pathNode) {
                logo.style.top = mstr.utils.BoxModel.position(pathNode).top - (mstr.utils.ISIE7 ? 2 : 0) + 'px'; //if there is any custom header
            }
        }

    }
};